home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc20 / stat.h < prev    next >
C/C++ Source or Header  |  1992-05-15  |  2KB  |  79 lines

  1. #ifndef _STAT_H
  2. #define _STAT_H
  3.  
  4. #ifndef _COMPILER_H
  5. #include <compiler.h>
  6. #endif
  7.  
  8. #ifndef _TYPES_H
  9. #include <types.h>
  10. #endif
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16. struct stat {
  17.     u_short    st_mode;
  18.     ino_t    st_ino;        /* must be 32 bits */
  19.     dev_t    st_dev;        /* must be 16 bits */
  20.     short    st_rdev;    /* not supported by the kernel */
  21.     short    st_nlink;
  22.     uid_t    st_uid;        /* must be 16 bits */
  23.     gid_t    st_gid;        /* must be 16 bits */
  24.     off_t    st_size;
  25.     off_t    st_blksize;
  26.     off_t    st_blocks;
  27.     time_t    st_mtime;
  28.     time_t    st_atime;
  29.     time_t    st_ctime;
  30.     short    st_attr;
  31. #ifdef __MINT__
  32.     short    res1;        /* reserved for future kernel use */
  33.     long    res2[2];
  34. #endif
  35. };
  36.  
  37. #define    S_IFMT            0170000
  38. #define    S_IFCHR            0020000
  39. #define    S_IFDIR            0040000
  40. #define S_IFBLK            0060000
  41. #define    S_IFREG            0100000
  42. #define S_IFIFO            0120000
  43. #define S_IMEM            0140000
  44. #define    S_IFLNK            0160000
  45.  
  46. #define    S_ISUID            04000
  47. #define    S_ISGID            02000
  48. #define    S_ISVTX            01000
  49. /* file access modes for user, group, and other*/
  50. #define S_IRUSR            0400
  51. #define S_IWUSR            0200
  52. #define S_IXUSR            0100
  53. #define S_IRGRP            0040
  54. #define S_IWGRP            0020
  55. #define S_IXGRP            0010
  56. #define S_IROTH            0004
  57. #define S_IWOTH            0002
  58. #define S_IXOTH            0001
  59.  
  60. #ifndef _POSIX_SOURCE
  61. #define    S_IREAD            S_IRUSR
  62. #define    S_IWRITE        S_IWUSR
  63. #define    S_IEXEC            S_IXUSR
  64. #define DEV_BSIZE        1024
  65. #endif
  66.  
  67. /* function definitions */
  68. __EXTERN int  stat    __PROTO((const char *, struct stat *));
  69. __EXTERN int  fstat    __PROTO((int, struct stat *));
  70. #ifndef _POSIX_SOURCE
  71. __EXTERN int  lstat    __PROTO((const char *, struct stat *));
  72. #endif
  73.  
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77.  
  78. #endif /* _STAT_H */
  79.